#include "Vector2.h"

namespace lib3dw 
{
	void Vector2::operator += (const float s)
	{
		x += s;
		y += s;
	}

	void Vector2::operator += (const Vector2 &v)
	{
		x += v.x;
		y += v.y;
	}

	void Vector2::operator -= (const float s)
	{
		x -= s;
		y -= s;
	}

	void Vector2::operator -= (const Vector2 &v)
	{
		x -= v.x;
		y -= v.y;
	}

	void Vector2::operator *= (const float s)
	{
		x *= s;
		y *= s;
	}

	void Vector2::operator *= (const Vector2 &v)
	{
		x *= v.x;
		y *= v.y;
	}

	void Vector2::operator /= (const float s)
	{
		x /= s;
		y /= s;
	}

	void Vector2::operator /= (const Vector2 &v)
	{
		x /= v.x;
		y /= v.y;
	}

	Vector2 operator + (const Vector2 &u, const Vector2 &v)
	{
		return Vector2(u.x + v.x, u.y + v.y);
	}

	Vector2 operator + (const Vector2 &v, const float s)
	{
		return Vector2(v.x + s, v.y + s);
	}

	Vector2 operator + (const float s, const Vector2 &v)
	{
		return Vector2(v.x + s, v.y + s);
	}

	Vector2 operator - (const Vector2 &u, const Vector2 &v)
	{
		return Vector2(u.x - v.x, u.y - v.y);
	}

	Vector2 operator - (const Vector2 &v, const float s)
	{
		return Vector2(v.x - s, v.y - s);
	}

	Vector2 operator - (const float s, const Vector2 &v)
	{
		return Vector2(v.x - s, v.y - s);
	}

	Vector2 operator - (const Vector2 &v)
	{
		return Vector2(-v.x, -v.y);
	}

	Vector2 operator * (const Vector2 &u, const Vector2 &v)
	{
		return Vector2(u.x * v.x, u.y * v.y);
	}

	Vector2 operator * (const float s, const Vector2 &v)
	{
		return Vector2(v.x * s, v.y * s);
	}

	Vector2 operator * (const Vector2 &v, const float s)
	{
		return Vector2(v.x * s, v.y * s);
	}

	Vector2 operator / (const Vector2 &u, const Vector2 &v)
	{
		return Vector2(u.x / v.x, u.y / v.y);
	}

	Vector2 operator / (const Vector2 &v, const float s)
	{
		return Vector2(v.x / s, v.y / s);
	}

	Vector2 operator / (const float s, const Vector2 &v)
	{
		return Vector2(s / v.x, s / v.y);
	}

	bool operator == (const Vector2 &u, const Vector2 &v)
	{
		return (u.x == v.x && u.y == v.y);
	}
}